/* Layout */
import Layout from '../views/layout/Layout'
import keepView from '../components/KeepRouterView'

/**
 * hidden: true                   if `hidden:true` will not show in the sidebar(default is false)
 * alwaysShow: true               if set true, will always show the root menu, whatever its child routes length
 *                                if not set alwaysShow, only more than one route under the children
 *                                it will becomes nested mode, otherwise not show the root menu
 * redirect: noredirect           if `redirect:noredirect` will no redirct in the breadcrumb
 * name:'router-name'             the name is used by <keep-alive> (must set!!!)
 * meta : {
    title: 'title'               the name show in submenu and breadcrumb (recommend set)
    icon: 'svg-name'             the icon show in the sidebar,
  }
 **/
export const constantRouterMap = [
  {path: '/login', name: 'login', component: () => import('@/views/login/index'), hidden: true},
  {path: '/404', component: () => import('@/views/404'), hidden: true},
  {path: '*', redirect: '/404', hidden: true},
  {
    path: '/',
    redirect: '/index'
  },
  {
    path: '',
    component: Layout,
    children: [{
      path: 'index',
      name: 'index',
      component: () => import('@/views/首页'),
      meta: {title: '首页', icon: 'icon-shouye'}
    }]
  },

  {
    path: '/shop',
    component: Layout,
    redirect: '/shop/list',
    name: 'shopManage',
    meta: {title: '门店管理', icon: 'icon-mendian'},
    children: [
      /* -------------------- 门店信息 ------------------ begin */
      {path: 'list', name: 'shopList', component: () => import('@/views/门店管理/门店列表'), meta: {title: '门店列表'}},
      {
        path: 'list/update/:id',
        name: 'shopListEdit',
        component: () => import('@/views/门店管理/门店列表/修改'),
        meta: {title: '编辑', update: true},
        hidden: true
      },
      {
        path: 'list/add',
        name: 'shopListAdd',
        component: () => import('@/views/门店管理/门店列表/添加'),
        meta: {title: '添加'},
        hidden: true
      },
      /* -------------------- 门店信息 ------------------ end */

      /* --------------------交班------------------ begin */
      {path: 'shiftList', name: 'shiftList', component: () => import('@/views/门店管理/交班列表'), meta: {title: '交班列表'}},
      {
        path: 'shiftList/detailTab',
        name: 'shiftDetailTab',
        component: () => import('@/views/门店管理/交班列表/交班详情'),
        meta: {title: '交班详情'},
        hidden: true
      },
      /*---------------------交班------------------ end */

      /* --------------------油枪------------------ begin */
      {path: 'oilGun', name: 'oilGun', component: () => import('@/views/门店管理/油枪列表'), meta: {title: '油枪列表'}},
      /*---------------------油枪------------------ end */
    ]
  },

  {
    path: '/member',
    component: Layout,
    redirect: '/member/list',
    name: 'member',
    meta: {title: '会员管理', icon: 'icon-huiyuanguanli'},
    children: [
      {path: 'list', name: 'memberList', component: () => import('@/views/会员管理/会员列表'), meta: {title: '会员列表'}},
      {path: 'grade', name: 'grade', component: () => import('@/views/会员管理/等级设置'), meta: {title: '等级设置'}},
      {path: 'phone', name: 'phone', component: () => import('@/views/会员管理/手机绑定'), meta: {title: '手机绑定'}}
    ]
  },

  {
    path: '/marketing',
    component: Layout,
    redirect: '/marketing/gift',
    name: 'marketing',
    meta: {title: '营销管理', icon: 'icon-yingxiao'},
    children: [
      /*----------------  礼品管理  ------------------- begin*/
      {
        path: '/marketing/gift',
        name: 'gift',
        component: keepView,
        redirect: '/marketing/gift/list',
        meta: {title: '礼品管理', icon: 'icon-yingxiaoshangjilei'},
        children: [{
          path: 'list',
          name: 'giftList',
          component: () => import('@/views/营销管理/礼品管理/礼品列表'),
          meta: {title: '礼品列表'}
        }, {
          path: 'add',
          name: 'giftAdd',
          component: () => import('@/views/营销管理/礼品管理/礼品列表/添加礼品'),
          meta: {title: '添加礼品'},
          hidden: true
        }, {
          path: 'update/:id',
          name: 'giftUpdate',
          component: () => import('@/views/营销管理/礼品管理/礼品列表/编辑礼品'),
          meta: {title: '编辑礼品', update: true},
          hidden: true
        }, {
          path: 'cash',
          name: 'giftCash',
          component: () => import('@/views/营销管理/礼品管理/兑换记录'),
          meta: {title: '兑换记录'}
        },{
          path: 'cash/detail',
          name: 'giftCashDetail',
          component: () => import('@/views/营销管理/礼品管理/兑换记录/兑换详情'),
          meta: {title: '兑换详情'},
          hidden: true
        }, {
          path: 'typeList',
          name: 'giftType',
          component: () => import('@/views/营销管理/礼品管理/礼品分类'),
          meta: {title: '礼品分类'}
        }]
      },
      /*----------------  礼品管理  ------------------- end*/
      {
        path: 'couponList',
        name: 'couponList',
        component: () => import('@/views/营销管理/优惠券管理/优惠券列表'),
        meta: {title: '优惠券列表', icon: 'icon-coupon'}
      }
    ]
  }
]


export default constantRouterMap
